package com.ap.core.dao.impl;

import com.ap.core.cxf.jaxb.common.ActivationStatus;
import com.ap.core.dao.AbstractAPCoreBaseJpaDao;
import com.ap.core.dao.MerchantDao;
import com.ap.core.domain.Merchant;
import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

/**
 * User: Rohit.Dixit
 * Jpa Implementation class for {@link com.ap.core.dao.MerchantDao}
 */
public class JpaMerchantDao extends AbstractAPCoreBaseJpaDao<Merchant, Long> implements MerchantDao{

    @Override
    public Merchant findById(Long primaryKey) {
        return findById(Merchant.class, primaryKey);
    }
    

	@Override
	public Merchant getMerchantByIdentification(String merchantIdentification) {
        Criteria criteria = getSession().createCriteria(Merchant.class);
        criteria.add(Restrictions.eq("merchantIdentification", merchantIdentification));
       // criteria.add(Restrictions.eq("activationStatus", ActivationStatus.ACTIVE));
        return (Merchant)criteria.uniqueResult();
	}


}
